import request from '@/utils/request'

export function addDevice(data) {
  return request({
    url: '/device/create',
    method: 'post',
    data
  })
}

export function updateDevice(data) {
  return request({
    url: '/device/update',
    method: 'post',
    data
  })
}


export function getDeviceList(data) {
  return request({
    url: '/device/list',
    method: 'post',
    data
  })
}

export function exportDevices(data) {
  return request({
    url: '/device/export',
    method: 'post',
    data
  })
}


export function deleteDevice(data) {
  return request({
    url: '/device/delete',
    method: 'post',
    data
  })
}

export function batchDelete(data) {
  return request({
    url: '/device/batch-delete',
    method: 'post',
    data
  })
}

export function sendCommand(data) {
  return request({
    url: '/device/command',
    method: 'post',
    data
  })
}

export function commandLogs(data) {
  return request({
    url: '/device/command-log',
    method: 'post',
    data
  })
}

export function exchange(data) {
  return request({
    url: '/device/exchange',
    method: 'post',
    data
  })
}

export function getLogs(data) {
  return request({
    url: '/device/logs',
    method: 'post',
    data
  })
}

export function weeklyMeter(data) {
  return request({
    url: '/device/weekly/meter',
    method: 'post',
    data
  })
}

export function deviceGroups(data) {
  return request({
    url: '/device/level/list',
    method: 'post',
    data
  })
}

export function deviceGroupsImport(data) {
  return request({
    url: '/device/level/import',
    method: 'post',
    data
  })
}

export function deviceGroupsExport(data) {
  return request({
    url: '/device/level/export',
    method: 'post',
    data
  })
}

export function deviceAllocPrice(data) {
  return request({
    url: '/device/price-alloc',
    method: 'post',
    data
  })
}

export function deviceBatchAllocPrice(data) {
  return request({
    url: '/device/price-alloc-batch',
    method: 'post',
    data
  })
}

export function batchUpdateDevice(data) {
  return request({
    url: '/device/batch-update',
    method: 'post',
    data
  })
}

export function exportPrice(data) {
  return request({
    url: '/device/price-export',
    method: 'post',
    responseType: 'blob',
    data
  })
}

